package com.ytjj.qmyx.mall.mapper;

import com.ytjj.qmyx.mall.model.ReissueLogistics;
import com.ytjj.qmyx.mall.model.ReissueLogisticsExample;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface ReissueLogisticsMapper {
    long countByExample(ReissueLogisticsExample example);

    int deleteByExample(ReissueLogisticsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(ReissueLogistics record);

    int insertSelective(ReissueLogistics record);

    List<ReissueLogistics> selectByExample(ReissueLogisticsExample example);

    ReissueLogistics selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") ReissueLogistics record, @Param("example") ReissueLogisticsExample example);

    int updateByExample(@Param("record") ReissueLogistics record, @Param("example") ReissueLogisticsExample example);

    int updateByPrimaryKeySelective(ReissueLogistics record);

    int updateRecoveryOrderNo(@Param("id")Integer id,
                              @Param("recoveryOrderNo")String recoveryOrderNo,
                              @Param("acquiringDay") Date acquiringDay,
                              @Param("reissueStatus")Integer reissueStatus,
                              @Param("productSkuSpec")String productSkuSpec,
                              @Param("userAddress")String userAddress ,
                              @Param("userName")String userName ,
                              @Param("userPhone")String userPhone,
                              @Param("descr")String descr);

    int updateByPrimaryKey(ReissueLogistics record);

    List<ReissueLogistics> selectByFinishStatus();

    /**
     * 查询补单类型为换货七天内未填写退货单号的补单记录
     */
    List<ReissueLogistics> queryWeekReissueLogistics();

    Integer refuseStatusAndReason(@Param("ids")List<Integer> ids,@Param("reason")String reason);


    Integer updateDeleteStatus(@Param("id") Integer id);

    void updateReissueLogistics(ReissueLogistics reissueLogistics);

    Integer updateReissueLogisticsProductSpec(@Param("productSkuSpec")String productSkuSpec,
                                              @Param("reissueLogisticsId") Integer reissueLogisticsId);
}